home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / C de cerca / Codewarrior Lite / MacOS Support / Headers / ANSI Headers / fcntl.h < prev    next >
Text File  |  1995-12-29  |  2KB  |  75 lines

  1. /*
  2.  *    File:        fcntl.h
  3.  *                ©1993-1995 metrowerks Inc. All rights reserved
  4.  *    Author:        Berardino E. Baratta
  5.  *
  6.  *    Content:    Interface file to standard UNIX-style entry points ...
  7.  *
  8.  *    NB:            This file implements some UNIX low level support.  These functions
  9.  *                are not guaranteed to be 100% conformant.
  10.  */
  11.  
  12. #ifndef    _FCNTL
  13. #define    _FCNTL
  14.  
  15. #pragma options align=mac68k
  16.  
  17. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  18. #pragma import on
  19. #endif
  20.  
  21. /* local typedefs (used by creat) */
  22. typedef unsigned long    mode_t;
  23.  
  24. /*
  25.  *    Mode values accessible to open()
  26.  */
  27. #define O_RDWR            0x0            /* open the file in read/write mode */
  28. #define O_RDONLY        0x1            /* open the file in read only mode */
  29. #define O_WRONLY        0x2            /* open the file in write only mode */
  30. #define O_APPEND        0x0100        /* open the file in append mode */
  31. #define O_CREAT            0x0200        /* create the file if it doesn't exist */
  32. #define O_EXCL            0x0400        /* if the file already exists don't create it again */
  33. #define O_TRUNC            0x0800        /* truncate the file after opening it */
  34. #define O_NRESOLVE        0x1000        /* Don't resolve any aliases */
  35. #define O_ALIAS            0x2000        /* Open alias file (if the file is an alias) */
  36. #define O_RSRC             0x4000        /* Open the resource fork */
  37. #define O_BINARY        0x8000        /* open the file in binary mode (default is text mode) */
  38.  
  39. /*
  40.  *    Commands available to fcntl()
  41.  */
  42. #define F_DUPFD            0x0            /* return a duplicate file descriptor */
  43.  
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47.  
  48. /*
  49.  *    Opens a file and returns it's id.
  50.  */
  51. int open(const char *path, int oflag);
  52.  
  53. /*
  54.  *    Creates and opens a file, returning the filenumber.  Note can only be used to set
  55.  *    binary mode (default is text mode) using O_BINARY
  56.  */
  57. int creat(const char *path, mode_t mode);
  58.  
  59. /*
  60.  *    File control routine.
  61.  */
  62. int fcntl(int fildes, int cmd, ...);
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67.  
  68. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  69. #pragma import reset
  70. #endif
  71.  
  72. #pragma options align=reset
  73.  
  74. #endif
  75.